<template>
  <div class="TopUpSuccess">
    <div class="imgBox">
      <img src="../assets/image/tixianchengg.png" alt="" />
    </div>
    <span>充值成功</span>
    <div class="btn">
      <p @click="back">返回</p>
    </div>
  </div>
</template>

<script>
import { alipayPayQueryOrder } from "@/api/reply";
export default {
  methods: {
    back() {
      let that = this;
      var u = navigator.userAgent;
      var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Adr") > -1; //android终端
      var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
      //判断手机：是Ios终端还是android终端
      if (isAndroid) {
        window.android.htmlBack();
      } else if (isiOS) {
        //Toast("IOS")
        window.location.href = "https://ios.outsea.psychexy.com/outsea";
        // this.$bridge.callhandler("htmlBack", "", (data) => {
        //   // 处理返回数据
        //   //Toast(data);
        //   console.log(111);
        // });
      } else {
        this.$toast("返回操作失败,请手动打开APP");
      }
    },
  },
  created() {
    if (localStorage.getItem("order_id")) {
      alipayPayQueryOrder({ order: localStorage.getItem("order_id") });
    }
  },
};
</script>

<style lang="less" scoped>
.TopUpSuccess {
  // background: #19162a;
  padding: 0px 25px;
  height: 100%;
  .imgBox {
    display: flex;
    justify-content: center;
    padding-top: 150px;
    img {
      width: 40%;
      height: 100%;
    }
  }
  span {
    color: #333;
    text-align: center;
    display: flex;
    justify-content: center;
    font-size: 15px;
    margin-top: 10px;
  }
  .btn {
    display: flex;
    justify-content: center;
    margin-top: 60px;
    p {
      width: 80%;
      height: 50px;
      background: linear-gradient(90deg, #d853ff 0%, #7439ff 100%);
      border-radius: 30px;
      color: white;
      font-size: 18px;
      display: flex;
      justify-content: center;
      font-weight: bold;
      align-items: center;
    }
  }
}
</style>